package com.zzx.day57Demo.Biz.impl;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.zzx.day57Demo.Biz.ExpectBiz;
import com.zzx.day57Demo.DAO.ExpectDAO;
import com.zzx.day57Demo.model.Expect;
@Service("expectBiz")
@Scope("prototype")
public class ExpectBizImpl implements ExpectBiz {
	private ExpectDAO expectDAO;

	public void setExpectDAO(ExpectDAO expectDAO) {
		this.expectDAO = expectDAO;
	}
	
	/* (non-Javadoc)
	 * @see com.zzx.day56Demo.Biz.impl.Exp#findAll()
	 */
	@Override
	public List<Expect> findAll(){
		return expectDAO.findAll();
		
	}
	
	/* (non-Javadoc)
	 * @see com.zzx.day56Demo.Biz.impl.Exp#save(com.zzx.day56Demo.Expect)
	 */
//	@Override
//	public void save(Expect exp){
//		expectDAO.save(exp);
//	}
	
	public void saveOrUpdate(Expect exp){
		
		expectDAO.saveOrUpdate(exp);
	}
	
	public Expect findById(int expId){
		return expectDAO.findById(expId);
	}
	
	public void delete(int expId){
		expectDAO.delete(expectDAO.findById(expId));
	}


}
